<?php
	class DbHelper
	{
		private $con;
		private $sDbName;
		public function __construct($server = 'localhost',
									$username = 'root',
									$password = 'root',
									//$password = '',
									//$databaseName = 'school_enrolment')
									$databaseName = 'enrolment_system')
		{
			$this->con = mysql_connect($server,
										$username,
										$password) or die(mysql_error());
			//
			$this->sDbName = $databaseName;
			mysql_select_db($databaseName) or die(mysql_error());
		}
		public final function setDatabaseName($name)
		{
			$this->sDbName = $name;
		}
		public final function query($sql)
		{
			return mysql_query($sql, $this->con) /*or die(mysql_error())*/;
		}
		public final function getConnection()
		{
			return $this->con;
		}
	}
?>